package com.yczy365.petmall.controller;

import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.yczy365.petmall.pojo.dto.AlbumAddNewDTO;
import com.yczy365.petmall.service.AlbumService;
import com.yczy365.petmall.web.JsonResult;
import com.yczy365.petmall.web.ServiceCode;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

@RestController
@RequestMapping("/album")
@Api(tags = "01.相册管理模板")
public class AlbumController {
    @Autowired
    AlbumService service;

    @PostMapping("add-new")
    @ApiOperation(value = "01.添加相册")
    @ApiOperationSupport(order = 200)
    public JsonResult addNew( @Valid AlbumAddNewDTO albumAddNewDTO){
        service.addNew(albumAddNewDTO);
        return JsonResult.ok();
    }
}
